using CustomerContactSystem.Core.Infrastructure.Domain;

namespace CustomerContactSystem.Core.Model {
    public class EnquiryAvoidable : Entity {
        public virtual Enquiry Enquiry { get; set; }
        public virtual string ReasonAvoidable { get; set; }

        protected override void Validate() {
            if (Enquiry == null) {
                AddBrokenRule(new BusinessRule("Enquiry", "Enquiry is required!"));
            }

            if (string.IsNullOrEmpty(ReasonAvoidable)) {
                AddBrokenRule(new BusinessRule("ReasonAvoidable", "Reason avoidable is required!"));
            }
        }
    }
}